<?php
/*
 * @Author: 李明
 * @Date: 2021-09-25 11:41:21
 * @LastEditTime: 2022-01-14 10:32:23
 * @LastEditors: 李明
 * @Description: 
 * @FilePath: /CRM2.0-PHP/app/Models/MessageModel.php
 * @山东壹零贰肆信息科技有限公司
 */

/**
 * Created by Reliese Model.
 */

namespace App\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;

/**
 * Class MessageModel
 * 
 * @property int $id
 * @property int|null $type
 * @property string|null $name
 * @property int|null $templateid
 * @property string|null $content
 * @property int|null $status
 * @property string|null $why
 * @property string|null $ihuyi_code
 * @property int|null $count
 * @property int|null $company_id
 * @property string|null $remark
 * @property Carbon|null $create_time
 * @property Carbon|null $update_time
 * 
 * @property Collection|MessageRecord[] $message_records
 *
 * @package App\Models
 */
class MessageModel extends Model
{
    protected $connection = 'mysql_sms';
    protected $table = 'message_model';

    protected $casts = [
        'type' => 'int',
        'templateid' => 'int',
        'status' => 'int',
        'count' => 'int',
        'company_id' => 'int'
    ];

    protected $fillable = [
        'type',
        'name',
        'templateid',
        'content',
        'status',
        'why',
        'ihuyi_code',
        'count',
        'company_id',
        'remark'
    ];

    public function message_records()
    {
        return $this->hasMany(MessageRecord::class);
    }
}
